package com.ftg.learn.bus.sharecarexp_record.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ftg.learn.bus.sharecarexp_record.entity.SharecarExpRecord;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SharecarExpRecordMapper extends BaseMapper<SharecarExpRecord> {

    /**
     * 公车经费自动添加记录
     * @param eid
     * @param name
     * @return
     */
    @Insert("insert into sharecar_exp_record (sharecar_expend_operate,sharecar_expend_operater,sharecar_expend_operaterdate) values (#{param1},#{param2},NOW());")
    int autoInsert(String eid,String name);

    /**
     * 查全部公车经费记录
     * @return
     */
    @Select("select * from deptexam_admin d left join sharecar_expendrecord_admin s on d.expendcar_id = s.expendcar_id;")
    List<SharecarExpRecord> showAll();
}
